package service;

import bean.AdInfo;
import dao.AdInfoDao;

import java.util.List;

/**
 * @ClassName : AdInfoService
 * @Auther : acerolan@foxmail.com
 * @Data : 2024/4/18 16:48
 * @Description :
 */

public class AdInfoService {

    AdInfoDao dao = new AdInfoDao();

    public List<AdInfo> GetAdsInfo() {
        return dao.GetAdsInfo();
    }

    public int BuyAd(String ad_brand_name, String ad_website, String ad_company_name, String ad_description, String ad_status, String ad_size, String ad_img, String user_id, String ad_hot, String ad_date) {
        return dao.BuyAd(ad_brand_name, ad_website, ad_company_name, ad_description, ad_status, ad_size, ad_img, user_id, ad_hot, ad_date);
    }

    public List<AdInfo> GetAdsInfoById(String user_id) {
        return dao.GetAdsInfoById(user_id);
    }


    public int insertAdsInfo(AdInfo adInfo){return dao.insertAds(adInfo);}

    public int updateAdsInfo(AdInfo adInfo){return dao.updateAds(adInfo);}

    public int delAdv(String adIds) {
        return dao.delAds(adIds);
    }

    public List<AdInfo> getAllInfo(){return dao.getAllInfo();}

    public int UpdateAdInfo(String ad_brand_name, String ad_website, String ad_company_name, String ad_description, String ad_id) {
        return dao.UpdateAdInfo(ad_brand_name, ad_website, ad_company_name, ad_description, ad_id);
    }

    public int DeleteAdById(String ad_id) {
        return dao.DeleteAdById(ad_id);
    }

    public int updateImg(String adImg,AdInfo adInfo){return dao.updateImg(adImg,adInfo);}

    public AdInfo SearchAdBy2Id(String ad_id, String user_id) {
        return dao.SearchAdBy2Id(ad_id, user_id);
    }

    public List<AdInfo> GetHotAdsInfo() {
        return dao.GetHotAdsInfo();
    }
}
